home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
jaz_clib.arc
/
POPDIR.DMO
< prev
next >
Wrap
Text File
|
1989-04-09
|
772b
|
30 lines
#include <pushpop.h>
int whandle,wread;
char wpath[STKRECSIZE];
char wpathfromroot[STKRECSIZE+1]; /* '\\' + wpath */
long fsize,jzsekfil();
main()
{
if ((whandle = jzopnfil(FNAME,2)) != -1) {
fsize = jzsekfil(whandle,0L,2); /* seek to end of file */
if (fsize) {
fsize -= (long) STKRECSIZE;
jzsekfil(whandle,fsize,0); /* seek to eof - 1 record */
jzredfil(whandle,wpath,STKRECSIZE);
strcpy(wpathfromroot,"\\"); /* start from root dir */
strcat(wpathfromroot,wpath); /* add full path */
chdir(wpathfromroot);
chsize(whandle,fsize); /* "pop" file (truncate) */
jzclsfil(whandle);
exit(0);
}
else
exit(1);
}
else
exit(1);
}